<template>
  <div class="rate">
    <div class="content">
      <div class="left m-r-20">
        <span class="title">{{ info.title }}</span>
        <span class="num">{{ info.num }}</span>
      </div>
      <div class="right">
        <div>
          <span>同比：{{ info.increase }}%</span>
          <div class="m-l-10"></div>
        </div>
        <div>
          <span>环比：{{ info.decrease }}%</span>
          <div class="m-l-10"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Rate",
  props: {
    width: {
      type: String,
      default: "100%",
    },
    height: {
      type: String,
      default: "100%",
    },
    info: {
      type: Object,
      default: () => {
        return {
          title: "共享资源总数",
          num: "19820",
          increase: "12",
          decrease: "12",
        };
      },
    },
  },
};
</script>

<style lang="less" scoped>
.title {
  font-size: 18px !important;
  color: #82bafa;
}
.num {
  font-size: 28px;
  margin-top: 10px;
}
.rate {
  border: 1px solid #114e97;
  background: #001636;
  height: 80px;
  // width: 300px;
  box-sizing: border-box;
  padding: 20px;
  margin: 0 auto;
  .content {
    // height: 60%;
    display: flex;
    color: #fff;
    .left {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;

      & > span:nth-of-type(1) {
        font-size: 24px;
        font-weight: bold;
      }
      & > span:nth-of-type(2) {
        font-weight: bold;
      }
    }
    .right {
      position: relative;
      top: 26px;
      // display: flex;
      // flex-direction: column;
      // align-items: center;
      // justify-content: space-between;
      & > div {
        font-size: 12px;
        display: flex;
        div {
          border: 6px solid transparent;
        }
      }
      & > div:nth-of-type(1) div {
        margin-bottom: 6px;
        border-bottom: 6px solid #adf242;
      }
      & > div:nth-of-type(2) div {
        margin-top: 6px;
        border-top: 6px solid red;
      }
    }
  }
}
</style>
